package games.tangchishe;

import java.awt.*;

/**
 * @Author GongXL
 * @Description TODO
 * @dATE 2021/11/16 18:11
 **/
public class Node {
    private int x;
    private int y;
    public Node(){

    }
    public Node(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
    /**
     * @Author GongXL
     * @Description  绘制节点
     * @Date 18:16 2021/11/16
     * @Param [java.awt.Graphics]
     * @return void
     **/
    public void drawNode(Graphics g,int i){
        //区分头和身体
        if(i == 0){
            g.fillOval(this.x,this.y,20-1,20-1);
        }else{
            g.fillRect(this.x,this.y,20-1,20-1);
        }


    }
}
